import login from './login'
import home from './home'
import goodsdetail from './goodsdetail'
import goodsinfo from './goodsinfo'
import myinfo from './myinfo'
// import {} from 'vite-plugin-mock'

export const  loginapi = { // 登录接口
    url: "/api/login",
    method: "get",
    response: (res) => {
        console.log(res);
        return login
        // if(res){
        //     if(res.params.loginName !== ''){
        //         return login
        //     }else{
        //         return {
        //             code: 401,
        //             message: "ok",
        //             data: {
        //                 msg:'用户认证失败'
        //             },
        //         }
        //     }
        // }
        
    }
}

export const homeapi = { // 首页数据
    url:"/api/homeinfo",
    method: "get",
    response: () => {
        return home
    }
}

export const goodsdetailapi = { // 商品类别详情
    url:"/api/goodsdetail",
    method: "get",
    response: () => {
        return goodsdetail
    }
}

export const goodsinfoapi = { // 商品详情信息
    url:'/api/goodsinfo',
    method: "get",
    response: ()=>{
        return goodsinfo
    }
}

export const myinfoapi = { // 我的用户信息
    url:'/api/myinfo',
    method: "get",
    response: () => {
        return myinfo
    }

}